<template>
  <div id="app">
    <img src="./assets/logo.png" />
    <p>
      <router-link to="/">Home</router-link>
      <router-link to="/news">新闻</router-link>
      <router-link to="/about">关于</router-link>
      <router-link to="/player/1">库里1</router-link>
      <router-link to="/player/2">哈登1</router-link>
    </p>
    <hr />
    <button @click="btnClick(1)">库里2</button>
    <button @click="btnClick(2)">哈登2</button>
    <hr />
    <router-link :to="{ name: 'Player', params: { uid: 1 } }"
      >库里3</router-link
    >
    <router-link :to="{ path: '/player/2/stats' }">哈登3</router-link>
    <hr />
    <router-view />
  </div>
</template>

<script>
import "./assets/my.css";
export default {
  name: "App",
  methods: {
    btnClick(uid) {
      this.$router.push({ path: `/player/${uid}` });
      //this.$router.push({ path: `/player/${uid}/stats` });
      //this.$router.push({ name: "Player", params: { uid: uid } });
      //this.$router.push({ path: '/player',query:{uid:uid} }); // 可以 get传参
      //this.$router.go(-1);
    },
  },
};
</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
